#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar a ;
bit flag;
sbit key1=P3^4;
sbit key2=P3^5;
sbit key3=P3^6;
sbit key4=P3^7;
void init()
{
	TMOD=0x20;
	TL1=0xFD;
	TH1=0xFD;
	TR1=1;
	EA=1;
	SM0=0;
	SM1=1;
	ES=1;

}
void main()
{
	init();
	while(1)
	{
		if(key1==0)
		{
			SBUF=0xfe;
			while(!TI);
			TI=0;
		}
		if(key2==0)
		{
			SBUF=0xfd;
			while(!TI);
			TI=0;
		}
		if(key3==0)
		{
			SBUF=0xfb;
			while(!TI);
			TI=0;
		}
		if(key4==0)
		{
			SBUF=0xf7;
			while(!TI);
			TI=0;
		}
	}
}
